package com.ccys.db.vo.doctor.patientHistory;

import com.alibaba.fastjson.JSONArray;
import com.ccys.db.vo.app.callStandByScreen.MedicalServiceMakeVo;
import com.ccys.db.vo.app.splashscreen.AllergiesMakeVo;
import com.ccys.db.vo.app.splashscreen.MedicationReactionsMakeVo;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;


@Data
public class BookingInfoVo {

    @JsonProperty("id")
    private String id;

    @JsonProperty("email")
    private String email;

    @JsonProperty("code")
    private String code;

    @JsonProperty("created_on")
    private String createdOn;

    @JsonProperty("age")
    private String age;

    @JsonProperty("status")
    private String status;

    @JsonProperty("status_value")
    private int statusValue;

    @JsonProperty("sub_status")
    private String subStatus;

    @JsonProperty("sub_status_value")
    private int subStatusValue;

    @JsonProperty("deeplink_name")
    private String deeplinkName;

    @JsonProperty("type")
    private String type;

    @JsonProperty("follow_up_code")
    private String followUpCode;

    @JsonProperty("follow_created_on")
    private String followCreatedOn;

    @JsonProperty("follow_timezone_created_on")
    private String followTimeZoneCreatedOn;

    @JsonProperty("follow_timezone")
    private String followTimeZone;

    @JsonProperty("follow_diagnosis")
    private String followDiagnosis;

    @JsonProperty("consultation_type")
    private String consultationType;

    @JsonProperty("is_waive_consultation_fee")
    private boolean isWaiveConsultationFee;

    @JsonProperty("waive_consultation_fee")
    private int waiveConsultationFee;

    @JsonProperty("waive_consultation_reason")
    private String waiveConsultationReason;

    @JsonProperty("total_cost_consulation")
    private BigDecimal totalCostConsulation;

    @JsonProperty("total_cost_prescription")
    private BigDecimal totalCostPrescription;

    @JsonProperty("delivery_fee")
    private int deliveryFee;

    @JsonProperty("doctor_first_name")
    private String doctorFirstName;

    @JsonProperty("doctor_last_name")
    private String doctorLastName;

    @JsonProperty("aia_corporate_id")
    private String aiaCorporateId;

    @JsonProperty("suboffname")
    private String suboffname;

    @JsonProperty("is_surcharge_fee")
    private boolean isSurchargeFee;

    @JsonProperty("surcharge_fee")
    private int surchargeFee;

    @JsonProperty("practice_fee")
    private int practiceFee;

    @JsonProperty("grand_total")
    private BigDecimal grandTotal;

    @JsonProperty("grand_total_included_tax")
    private BigDecimal grandTotalIncludedTax;

    @JsonProperty("grand_total_payment")
    private int grandTotalPayment;

    @JsonProperty("consultant_begin_date")
    private String consultantBeginDate;

    @JsonProperty("consultant_end_date")
    private String consultantEndDate;

    @JsonProperty("booking_time_zone")
    private String bookingTimeZone;

    @JsonProperty("timezone_consultant_begin_date")
    private String timezoneConsultantBeginDate;

    @JsonProperty("timezone_consultant_end_time")
    private String timezoneConsultantEndTime;

    @JsonProperty("need_medical_letter")
    private boolean needMedicalLetter;

    @JsonProperty("medical_letter_code")
    private String medicalLetterCode;

    @JsonProperty("medical_letter")
    private String medicalLetter;

    @JsonProperty("need_medical_certification")
    private boolean needMedicalCertification;

    @JsonProperty("medical_certification_code")
    private String medicalCertificationCode;

    @JsonProperty("medical_certification_begin_date")
    private String medicalCertificationBeginDate;

    @JsonProperty("medical_certification_end_date")
    private String medicalCertificationEndDate;

    @JsonProperty("medical_certification_additional_note")
    private String medicalCertificationAdditionalNote;

    @JsonProperty("diagnosis")
    private String diagnosis;

    @JsonProperty("diagnosis_trans")
    private String diagnosisTrans;

    @JsonProperty("flag_patient_id")
    private String flagPatientId;

    @JsonProperty("flag_patient_note")
    private String flagPatientNote;

    @JsonProperty("presenting_complaint")
    private String presentingComplaint;

    @JsonProperty("management")
    private String management;

    @JsonProperty("instructions_to_patient")
    private String instructionsToPatient;

    @JsonProperty("twilio_room")
    private String twilioRoom;

    @JsonProperty("QR_code")
    private String qrCode;

    @JsonProperty("show_memo")
    private String showMemo;

    @JsonProperty("memo")
    private String memo;

    @JsonProperty("memo_email")
    private String memoEmail;

    @JsonProperty("log_date")
    private String logDate;

    @JsonProperty("medication_approved_at")
    private String medicationApprovedAt;

    @JsonProperty("medication_approved_by")
    private String medicationApprovedBy;

    @JsonProperty("medication_approved_doctor_name")
    private String medicationApprovedDoctorName;

    @JsonProperty("patient_country_of_residence")
    private int patientCountryOfResidence;

    @JsonProperty("doctor_country_of_residence")
    private int doctorCountryOfResidence;

    @JsonProperty("queue_no")
    private String queueNo;

    @JsonProperty("total_consulation")
    private int totalConsulation;

    @JsonProperty("feedback")
    private String feedback;

    @JsonProperty("G6PD")
    private boolean g6pd;

    @JsonProperty("pregnant")
    private boolean pregnant;

    @JsonProperty("aia_member")
    private boolean aiaMember;

    @JsonProperty("aia_identifier")
    private String aiaIdentifier;

    @JsonProperty("specialisation_id")
    private int specialisationId;

    @JsonProperty("patient_weight")
    private String patientWeight;

    @JsonProperty("patient_height")
    private String patientHeight;

    @JsonProperty("patient_temp")
    private String patientTemp;

    @JsonProperty("patient_bp1")
    private String patientBp1;

    @JsonProperty("patient_bp2")
    private String patientBp2;

    @JsonProperty("patient_hr")
    private String patientHr;

    @JsonProperty("mem_summary")
    private String memSummary;

    @JsonProperty("diagnosis_allow_patient_to_claim")
    private boolean diagnosisAllowPatientToClaim;

    @JsonProperty("booking_consultation_type")
    private String bookingConsultationType;

    @JsonProperty("is_follow_up_action")
    private String isFollowUpAction;

    @JsonProperty("referrals")
    private List<Referrals> referrals;

    //todo 需要新order表
    @JsonProperty("delivery_type")
    private String deliveryType;

    @JsonProperty("reason")
    private String reason;

    @JsonProperty("patient_waited")
    private int patientWaited;

    //医生赚的钱，废弃
    @JsonProperty("consult_fee")
    private BigDecimal consultFee;

    //医生赚的钱，废弃
    @JsonProperty("medication_fee")
    private BigDecimal medicationFee;

    //1.0查询废弃的表，所以为空
    @JsonProperty("corporate")
    private String corporate;

    //1.0查询废弃的表，所以为空
    @JsonProperty("subscription")
    private String subscription;

    //获取所有症状图片，然后解密 [{"photo":"xxxxx"}]
    @JsonProperty("symptoms_photos")
    private JSONArray symptomsPhotos;

    private String symptomsPhotosStr;

    //todo 未知
    @JsonProperty("specialist_referral_letter_photos")
    private String specialistReferralLetterPhotos;


    @JsonProperty("product_packages")
    private List<DoctorGetBookingDetailProductPackagesVo> productPackages;

    @JsonProperty("medical_service")
    private List<MedicalServiceMakeVo> medicalService;

    //null 1.0查询有问题
    @JsonProperty("flag_patient")
    private String flagPatient;

    @JsonProperty("cdmp_program_benefit_name")
    private String cdmpProgramBenefitName;

    @JsonProperty("cdmp_total_amount")
    private String cdmpTotalAmount;

    @JsonProperty("basic_cdmp_information")
    private String basicCdmpInformation;

    @JsonProperty("is_cdmp_chronic")
    private boolean isCdmpChronic;

    @JsonProperty("cdmp_status")
    private String cdmpStatus;

    @JsonProperty("upload_files")
    private List<UploadFiles> uploadFiles;

    @JsonProperty("service_type_name")
    private String serviceTypeName;

    //todo 未知
    @JsonProperty("is_pim")
    private boolean isPim;

    @JsonProperty("cdmp_program_benefit_id")
    private String cdmpProgramBenefitId;

    @JsonProperty("symptoms")
    private JSONArray symptoms;

    @JsonProperty("delivery_fee_detail")
    private List<Delivery_fee_detail> deliveryFeeDetail;

    private Tax tax;

    @JsonProperty("delivery_address")
    private List<Delivery_address> deliveryAddress;

    private List<Pharmacy> pharmacy;

    @JsonProperty("medications")
    private List<MedicationsMakeVo> medications;

    //[{"name":xxx,"index":xx}]
    @JsonProperty("allergies")
    private List<AllergiesMakeVo> allergies;

    //[{"name":xxx,"index":xx,"otherreaction":null}]
    @JsonProperty("medication_reactions")
    private List<MedicationReactionsMakeVo> medicationReactions;

    @JsonProperty("longterms")
    private List<LongtermsMakeVo> longterms;

    private Patient patient;

    private List<Prescription> prescription;

    @JsonProperty("prescription_photos")
    private List<PrescriptionPhotos> prescriptionPhotos;

    private Member member;

    @JsonProperty("booking_cdmp_condition")
    private List<BookingCdmpConditionMakeVo> bookingCdmpCondition;

    @Data
    public static class PrescriptionPhotos{
        private String id;

        @JsonProperty("booking_prescription_id")
        private String bookingPrescriptionId;

        private String photo;

        @JsonProperty("created_on")
        private String createdOn;
    }

    @Data
    public static class Delivery_fee_detail{
        private int ordering;

        private int fee;

        @JsonProperty("is_payment")
        private boolean isPayment;
    }
    
    @Data
    public static class Tax
    {
        private int amount;

        private String type;

        private BigDecimal fee;
    }

    @Data
    public static class Delivery_address {

        @JsonProperty("first_name")
        private String firstName;

        @JsonProperty("last_name")
        private String lastName;

        @JsonProperty("phone")
        private String phone;

        @JsonProperty("postal_code")
        private String postalCode;

        @JsonProperty("address")
        private String address;

        @JsonProperty("floor_number")
        private String floorNumber;

        @JsonProperty("latitude")
        private BigDecimal latitude;

        @JsonProperty("longitude")
        private BigDecimal longitude;

        @JsonProperty("timeslot_id")
        private String timeslotId;

        @JsonProperty("start_time")
        private String startTime;

        @JsonProperty("end_time")
        private String endTime;
    }

    @Data
    public static class Pharmacy {
        @JsonProperty("id")
        private String id;

        @JsonProperty("name")
        private String name;

        @JsonProperty("phone")
        private String phone;

        @JsonProperty("postal_code")
        private String postalCode;

        @JsonProperty("address")
        private String address;

        @JsonProperty("floor_number")
        private String floorNumber;

        @JsonProperty("latitude")
        private BigDecimal latitude;

        @JsonProperty("longitude")
        private BigDecimal longitude;

        @JsonProperty("type")
        private String type;

        @JsonProperty("p_image")
        private String pImage;

        @JsonProperty("p_updated_on")
        private String pUpdatedOn;
    }

    @Data
    public static class Patient {
        @JsonProperty("signature")
        private JSONArray signature;

        @JsonProperty("mem_type_id")
        private String memTypeId;

        @JsonProperty("front_identification_card_photo")
        private String frontIdentificationCardPhoto;

        @JsonProperty("back_identification_card_photo")
        private String backIdentificationCardPhoto;

        @JsonProperty("passport_photo")
        private String passportPhoto;

        @JsonProperty("birth_certificate")
        private String birthCertificate;

        @JsonProperty("front_driving_license")
        private String frontDrivingLicense;

        @JsonProperty("back_driving_license")
        private String backDrivingLicense;

        @JsonProperty("front_general_card_photo")
        private String frontGeneralCardPhoto;

        @JsonProperty("back_general_card_photo")
        private String backGeneralCardPhoto;
    }

    @Data
    public static class Prescription {
        @JsonProperty("id")
        private String id;

        @JsonProperty("name")
        private String name;

        @JsonProperty("ingredient_only")
        private String ingredientOnly;

        @JsonProperty("name_only")
        private String nameOnly;

        @JsonProperty("quantity")
        private int quantity;

        @JsonProperty("price")
        private double price;

        @JsonProperty("amount")
        private double amount;

        @JsonProperty("patient_instruction")
        private String patientInstruction;

        @JsonProperty("pharmacist_instruction")
        private String pharmacistInstruction;

        @JsonProperty("refill")
        private int refill;

        @JsonProperty("refill_expiry_date")
        private String refillExpiryDate;

        @JsonProperty("dosage")
        private int dosage;

        @JsonProperty("dosage_text")
        private String dosageText;

        @JsonProperty("frequency")
        private String frequency;

        @JsonProperty("what_is_for")
        private String whatIsFor;

        @JsonProperty("causes_drowsiness")
        private boolean causesDrowsiness;

        @JsonProperty("any_precautions")
        private String anyPrecautions;

        @JsonProperty("unit_dosage_form")
        private String unitDosageForm;

        @JsonProperty("duration")
        private int duration;

        @JsonProperty("recommended_dosage")
        private String recommendedDosage;

        @JsonProperty("recommended_frequency")
        private String recommendedFrequency;

        @JsonProperty("recommended_no_of_tables")
        private String recommendedNoOfTables;

        @JsonProperty("remarks")
        private String remarks;

        @JsonProperty("per_tablet_dosage")
        private int perTabletDosage;

        @JsonProperty("pharmacy_id")
        private String pharmacyId;

        @JsonProperty("pharmacy_name")
        private String pharmacyName;

        @JsonProperty("formulation_name")
        private String formulationName;

        @JsonProperty("route_doctor_name")
        private String routeDoctorName;

        @JsonProperty("route_patient_name")
        private String routePatientName;

        @JsonProperty("uom_quantity")
        private int uomQuantity;

        @JsonProperty("prn")
        private boolean prn;

        @JsonProperty("prn_reason")
        private String prnReason;

        @JsonProperty("unit")
        private int unit;

        @JsonProperty("unit_name")
        private String unitName;

        @JsonProperty("duration_unit")
        private int durationUnit;

        @JsonProperty("duration_unit_name")
        private String durationUnitName;

        @JsonProperty("status")
        private String status;

        @JsonProperty("status_value")
        private int statusValue;

        @JsonProperty("booking_prescription_id")
        private int bookingPrescriptionId;

        @JsonProperty("verified")
        private boolean verified;

        @JsonProperty("doctor_verify")
        private String doctorVerify;

        @JsonProperty("doctor_name")
        private String doctorName;

        @JsonProperty("is_in_exclusion_list")
        private int isInExclusionList;

        @JsonProperty("is_partner")
        private String isPartner;

        @JsonProperty("product_id")
        private String productId;

        @JsonProperty("remark")
        private String remark;

        @JsonProperty("is_original")
        private boolean isOriginal;

        @JsonProperty("is_showing_for_member")
        private boolean isShowingForMember;

        @JsonProperty("step_dose_medications")
        private List<Step_dose_medications> stepDoseMedications;

        @JsonProperty("take_complete_course")
        private boolean takeCompleteCourse;

        @JsonProperty("fulfilled_status")
        private String fulfilledStatus;

        @JsonProperty("is_covered_diagnosis")
        private boolean isCoveredDiagnosis;

        @JsonProperty("covered_diagnosis_regex")
        private String coveredDiagnosisRegex;

        @JsonProperty("prescription_is_in_exclusion_list")
        private int prescriptionIsInExclusionList;

        @JsonProperty("covered_diagnosis_code")
        private String coveredDiagnosisCode;
    }
    @Data
    public static class Member {
        @JsonProperty("id")
        private String id;

        @JsonProperty("first_name")
        private String firstName;

        @JsonProperty("last_name")
        private String lastName;

        @JsonProperty("nric_fin")
        private String nricFin;

        @JsonProperty("date_of_birth")
        private String dateOfBirth;

        @JsonProperty("email")
        private String email;

        @JsonProperty("gender")
        private String gender;

        @JsonProperty("mem_phone")
        private String memPhone;

        @JsonProperty("mem_home_address")
        private String memHomeAddress;

        @JsonProperty("profile_photo")
        private String profilePhoto;

        @JsonProperty("mem_code")
        private String memCode;

        @JsonProperty("child")
        private Child child;
    }
    @Data
    public static class Step_dose_medications {
        @JsonProperty("id")
        private String id;

        @JsonProperty("name")
        private String name;

        @JsonProperty("ingredient_only")
        private String ingredientOnly;

        @JsonProperty("name_only")
        private String nameOnly;

        @JsonProperty("quantity")
        private int quantity;

        @JsonProperty("price")
        private double price;

        @JsonProperty("amount")
        private double amount;

        @JsonProperty("patient_instruction")
        private String patientInstruction;

        @JsonProperty("pharmacist_instruction")
        private String pharmacistInstruction;

        //全是0
        @JsonProperty("refill")
        private int refill;

        //空
        @JsonProperty("refill_expiry_date")
        private String refillExpiryDate;

        @JsonProperty("dosage")
        private int dosage;

        @JsonProperty("dosage_text")
        private String dosageText;

        @JsonProperty("frequency")
        private String frequency;

        @JsonProperty("what_is_for")
        private String whatIsFor;

        @JsonProperty("causes_drowsiness")
        private boolean causesDrowsiness;

        @JsonProperty("any_precautions")
        private String anyPrecautions;

        //不再使用
        @JsonProperty("unit_dosage_form")
        private String unitDosageForm;

        @JsonProperty("duration")
        private int duration;

        @JsonProperty("recommended_dosage")
        private String recommendedDosage;

        @JsonProperty("recommended_frequency")
        private String recommendedFrequency;

        //todo 无此字段
        @JsonProperty("recommended_no_of_tables")
        private String recommendedNoOfTables;

        @JsonProperty("remarks")
        private String remarks;

        @JsonProperty("per_tablet_dosage")
        private int perTabletDosage;

        @JsonProperty("pharmacy_id")
        private String pharmacyId;

        @JsonProperty("pharmacy_name")
        private String pharmacyName;

        @JsonProperty("formulation_name")
        private String formulationName;

        @JsonProperty("route_doctor_name")
        private String routeDoctorName;

        @JsonProperty("route_patient_name")
        private String routePatientName;

        @JsonProperty("UOM_quantity")
        private int uomQuantity;

        @JsonProperty("prn")
        private boolean prn;

        @JsonProperty("prn_reason")
        private String prnReason;

        @JsonProperty("unit")
        private int unit;

        @JsonProperty("unit_name")
        private String unitName;

        @JsonProperty("duration_unit")
        private int durationUnit;

        @JsonProperty("duration_unit_name")
        private String durationUnitName;

        @JsonProperty("status")
        private String status;

        @JsonProperty("status_value")
        private int statusValue;

        @JsonProperty("booking_prescription_id")
        private int bookingPrescriptionId;

        @JsonProperty("verified")
        private boolean verified;

        @JsonProperty("doctor_verify")
        private String doctorVerify;

        @JsonProperty("doctor_name")
        private String doctorName;

        @JsonProperty("is_in_exclusion_list")
        private int isInExclusionList;

        @JsonProperty("is_partner")
        private String isPartner;

        //todo 未知
        @JsonProperty("product_id")
        private String productId;

        @JsonProperty("remark")
        private String remark;

        @JsonProperty("is_original")
        private boolean isOriginal;

        @JsonProperty("is_showing_for_member")
        private boolean isShowingForMember;

        @JsonProperty("step_dose")
        private String stepDose;

        @JsonProperty("take_complete_course")
        private boolean takeCompleteCourse;

        //todo 未知
        @JsonProperty("fulfilled_status")
        private String fulfilledStatus;

        @JsonProperty("is_covered_diagnosis")
        private boolean isCoveredDiagnosis;

        @JsonProperty("covered_diagnosis_regex")
        private String coveredDiagnosisRegex;

        //todo 未知
        @JsonProperty("prescription_is_in_exclusion_list")
        private int prescriptionIsInExclusionList;

        @JsonProperty("covered_diagnosis_code")
        private String coveredDiagnosisCode;
    }

    @Data
    public static class Child {
        @JsonProperty("email")
        private String email;

        @JsonProperty("id")
        private String id;

        @JsonProperty("first_name")
        private String firstName;

        @JsonProperty("last_name")
        private String lastName;

        @JsonProperty("nric_fin")
        private String nricFin;

        @JsonProperty("gender")
        private String gender;

        @JsonProperty("singpass_gender")
        private String singpassGender;

        @JsonProperty("relationship")
        private String relationship;

        @JsonProperty("age")
        private Integer age;

        @JsonProperty("date_of_birth")
        private String dateOfBirth;

        @JsonProperty("profile_photo")
        private String profilePhoto;

        @JsonProperty("mem_code")
        private String memCode;
    }

    @Data
    public static class Referrals{
        @JsonProperty("specialist_id")
        private int specialistId;

        @JsonProperty("MDST_ID")
        private int mdstId;

        @JsonProperty("specialisation_type")
        private String specialisationType;

        @JsonProperty("specialist_company_name")
        private String specialistCompanyName;

        @JsonProperty("specialist_name")
        private String specialistName;

        @JsonProperty("specialist_mobile")
        private String specialistMobile;

        @JsonProperty("specialist_clinic_name")
        private String specialistClinicName;

        @JsonProperty("specialist_address")
        private String specialistAddress;

        @JsonProperty("referral_letter_text")
        private String referralLetterText;

        @JsonProperty("referral_letter_code")
        private String referralLetterCode;
    }

    @Data
    public static class UploadFiles{
        @JsonProperty("file_name")
        private String fileName;

        @JsonProperty("file_path")
        private String filePath;

        @JsonProperty("file_order")
        private String fileOrder;
    }

    private String currentLanguage;

    private BigDecimal taxRate;

    private Integer taxRateType;

    private String memId;

    private String patientMemId;

    private Integer memType;

    private String frontIdentificationPhoto;

    private String backIdentificationPhoto;

    private String symptomsStr;
}
